//
//  YSOrderDetailVolumeCell.m
//  Yueshi
//
//  Created by Northwan on 15/8/5.
//  Copyright (c) 2015年 悦食中国. All rights reserved.
//

#import "YSOrderDetailVolumeCell.h"
@interface YSOrderDetailVolumeCell()
@property (weak, nonatomic) IBOutlet UILabel *volumeNumLabel;
@property (weak, nonatomic) IBOutlet UILabel *statusLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;

@end
@implementation YSOrderDetailVolumeCell

+(instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *CellIdentiferId = @"YSOrderDetailVolumeCell";
    YSOrderDetailVolumeCell *cell =  [tableView dequeueReusableCellWithIdentifier:CellIdentiferId];
    if(cell == nil){
        NSArray *nibs = [[NSBundle mainBundle]loadNibNamed:@"YSOrderDetailVolumeCell" owner:nil options:nil];
        cell = [nibs lastObject];
    }
    return cell;
}

-(void)setVolumeItem:(YSVolumeItem *)volumeItem{
    _volumeItem = volumeItem;
    [self.volumeNumLabel  setText:volumeItem.volumeYards];
    
    switch (volumeItem.useStatus) {
        case 0://未使用
            [self.statusLabel setText:@"未使用"];
            break;
        case 1://已使用
            [self.statusLabel setText:@"已使用"];
            break;
        case 2://已过期
            [self.statusLabel setText:@"已过期"];
            break;
            
        default:
            break;
    }
    [self.timeLabel setText:[Utils string2Millisecs:volumeItem.validTime]];
}


@end
